﻿
@{
    ViewBag.Title = "药品过期查询";
    Layout = "~/Views/Shared/_Index.cshtml";
    //报表链接
    var reportUrl = SysConfigReader.OrgReportLink();
}

<div class="rows">
	<div class="panel panel-default">
		<table class="form">
			<tr>
				<th class="formTitle">过期日期：</th>
				<td class="formValue" style="padding-left:20px;">
					<input id="time" type="text" class="form-control input-wdatepicker form-an" style="width: 160px;"
						   onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})" value="@(DateTime.Now.ToString("yyyy-MM-01 00:00:00"))" />
				</td>
				<th class="formTitle"></th>
				<td class="formValue" style="padding-left:20px;">
					<input type="button" id="btn_search" onclick="submit();" class="btn btn-primary btn-md" value="查询" style="width:55px" />
				</td>
			</tr>
		</table>
	</div>
	<input type="text" id="zxys" hidden="hidden" />
</div>

<div class="ui-layout" id="layout" style="height:100%;width:100%;">
	<iframe class="ui-layout-center" style="width:100%;" id="iframerightiframerightiframerightttt" name="iframerightiframerightiframerightttt"
			scrolling="auto" allowtransparency="true" frameborder="0"></iframe>
</div>

<script type="text/javascript">
	var reportServerHOST = '@(ViewBag.ReportServerHOST)';
    var organId = '@(ViewBag.OrganizeId)';
    function submit() {
        var url = getUrl();
		url += "&organid=" + organId + "&time=" + $('#time').val();
        setTimeout("$.loading(true, '正在请求报表页面...');", 10);
        $("#iframerightiframerightiframerightttt").attr('src', url);
    }

    $("#iframerightiframerightiframerightttt").load(function () {
        $.loading(false);
	});

    $(function () {
        var h = $(window).height() - 65
        $('#layout iframe').css('height', h);
        //init();
    });

    //刷新列表
    function refReport() {
        $("#btn_search").trigger('click');
    }
    
    function getUrl() {
        var reportServerHOST = '@(ViewBag.ReportServerHOST)';
        reportServerHOST += "/Pages/ReportViewer.aspx?%2fNewtouch.HIS.Bill%2f药品过期预警";
        //获取自定义样式
        if (true) {
            if (reportServerHOST.indexOf('&rc:Stylesheet') == -1) {
                reportServerHOST += "&rc:Stylesheet=MyStyleSheet";
            }
        }

        return reportServerHOST;
    }

</script>